<template>
  <div style="background: #fff">
    <div class="tab_menu">
      <div>
        <span v-for="(item,index) in menus" :class="{'choose':index===menuIndex}" @click="chooseMenu(index)">{{item}}</span>
      </div>
    </div>
    <warningInfo  v-if="menuIndex===0" />
    <warningConfirm v-if="menuIndex===1"/>
    <errorInfo v-if="menuIndex===2" />
    <errorReset v-if="menuIndex===3" />
  </div>
</template>

<script>
  import warningInfo from "./warningInfo";
  import warningConfirm from "./warningConfirm";
  import errorReset from "./errorReset";
  import errorInfo from "./errorInfo";

  export default {
    components: {
      warningInfo,
      warningConfirm,
      errorReset,
      errorInfo,
    },
    data() {
      return {
        menus: ['报警信息', '报警确认', '故障信息', '故障复位'],
        menuIndex: 0,
      }
    },
    mounted() {

    },
    methods: {
      chooseMenu(index){
        this.menuIndex = index;
      }
    }
  }
</script>

<style scoped>
  .tab_menu {
    padding: 10px;
  }

  .tab_menu div {
    height: 43px;
    display: flex;
    width: 100%;
    border-bottom: 2px solid #427EF1;
  }

  .tab_menu span {
    line-height: 43px;
    width: 120px;
    text-align: center;
    cursor: pointer;
  }

  .tab_menu .choose {
    background: #427EF1;
    color: #fff;
  }


  .address a {
    color: #427EF1;
    font-size: 14px;
    margin-left: 20px;
    cursor: pointer;
  }
</style>
